/*
 * @lc app=leetcode.cn id=1822 lang=javascript
 *
 * [1822] 数组元素积的符号
 */

// @lc code=start
/**
 * @param {number[]} nums
 * @return {number}
 */
var arraySign = function (nums) {
  let res = 1;
  for (let num of nums) {
    if (num === 0) {
      return 0;
    } else if (num > 0) {
      res *= 1;
    } else {
      res *= -1;
    }
  }
  return res;
};
// @lc code=end

